<template>
    <el-switch v-model="modelValue" size="small" inline-prompt :active-icon="Sunny"
        :inactive-icon="Moon" @change="toggleDark()" />
</template>

<script setup>
/**
 * 暗黑模式主题切换组件
 */
import { ref } from 'vue';
import { Sunny, Moon } from '@element-plus/icons-vue';
import { useDark, useToggle } from '@vueuse/core';

const modelValue = ref(true);
const isDark = useDark();
const toggleDark = useToggle(isDark);
</script>